package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementSrNeighbMapper;
import com.ruoyi.net.domain.ElementSrNeighb;
import com.ruoyi.net.service.IElementSrNeighbService;

/**
 * 网元-SR-邻居标签Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementSrNeighbServiceImpl implements IElementSrNeighbService 
{
    @Autowired
    private ElementSrNeighbMapper elementSrNeighbMapper;

    /**
     * 查询网元-SR-邻居标签
     * 
     * @param id 网元-SR-邻居标签主键
     * @return 网元-SR-邻居标签
     */
    @Override
    public ElementSrNeighb selectElementSrNeighbById(String id)
    {
        return elementSrNeighbMapper.selectElementSrNeighbById(id);
    }

    /**
     * 查询网元-SR-邻居标签列表
     * 
     * @param elementSrNeighb 网元-SR-邻居标签
     * @return 网元-SR-邻居标签
     */
    @Override
    public List<ElementSrNeighb> selectElementSrNeighbList(ElementSrNeighb elementSrNeighb)
    {
        return elementSrNeighbMapper.selectElementSrNeighbList(elementSrNeighb);
    }

    /**
     * 新增网元-SR-邻居标签
     * 
     * @param elementSrNeighb 网元-SR-邻居标签
     * @return 结果
     */
    @Override
    public int insertElementSrNeighb(ElementSrNeighb elementSrNeighb)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementSrNeighb.getId())) {
            elementSrNeighb.setId(uuid);
        }
        elementSrNeighb.setCreateBy(SecurityUtils.getUsername());
        elementSrNeighb.setCreateTime(DateUtils.getNowDate());
        elementSrNeighb.setUpdateBy(SecurityUtils.getUsername());
        elementSrNeighb.setUpdateTime(DateUtils.getNowDate());
        return elementSrNeighbMapper.insertElementSrNeighb(elementSrNeighb);
    }

    /**
     * 修改网元-SR-邻居标签
     * 
     * @param elementSrNeighb 网元-SR-邻居标签
     * @return 结果
     */
    @Override
    public int updateElementSrNeighb(ElementSrNeighb elementSrNeighb)
    {
        elementSrNeighb.setUpdateBy(SecurityUtils.getUsername());
        elementSrNeighb.setUpdateTime(DateUtils.getNowDate());
        return elementSrNeighbMapper.updateElementSrNeighb(elementSrNeighb);
    }

    /**
     * 批量删除网元-SR-邻居标签
     * 
     * @param ids 需要删除的网元-SR-邻居标签主键
     * @return 结果
     */
    @Override
    public int deleteElementSrNeighbByIds(String[] ids)
    {
        return elementSrNeighbMapper.deleteElementSrNeighbByIds(ids);
    }

    /**
     * 删除网元-SR-邻居标签信息
     * 
     * @param id 网元-SR-邻居标签主键
     * @return 结果
     */
    @Override
    public int deleteElementSrNeighbById(String id)
    {
        return elementSrNeighbMapper.deleteElementSrNeighbById(id);
    }
}
